﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using VisionCloud.Core.Model.Enums;

namespace VisionCloud.Core.Model.Ms
{
    [Table("MsReport")]
    public class MsReport : BaseEntity
    {
        /// <summary>
        /// 报告主键
        /// </summary>
        [Key]
        public Guid YunReportGuid { get; set; }

        /// <summary>
        /// 设备Guid
        /// </summary>
        [Column(TypeName = "uuid")]
        public Guid DeviceGuid { get; set; }

        /// <summary>
        /// 项目Guid
        /// </summary>
        [Column(TypeName = "uuid")]
        public Guid YunProjectGuid { get; set; }

        /// <summary>
        /// surface
        /// </summary>
        [Column(TypeName = "uuid")]
        public Guid TaskReportId { get; set; }

        [Column(TypeName = "uuid")]
        public Guid ProjectId { get; set; }

        [Column(TypeName = "uuid")]
        public Guid TaskId { get; set; }

        [Column(TypeName = "uuid")]
        public Guid? FileId { get; set; }

        /// <summary>
        /// 云端任务Id
        /// </summary>
        [Column(TypeName = "uuid")]
        public Guid YunTaskId { get; set; }

        [Column(TypeName = "varchar(64)")]
        public string RobotId { get; set; }

        [Column(TypeName = "int4")]
        public int ReportType { get; set; }

        [Column(TypeName = "varchar(255)")]
        public string ReportName { get; set; }

        [Column(TypeName = "varchar(500)")]
        public string ReportPath { get; set; }

        public bool IsNew { get; set; }

        [NotMapped]
        public Boolean IsImportFile { get => string.IsNullOrEmpty(ReportPath); }

        [Column(TypeName = "timestamp")]
        public DateTime CreateReportDateTime { get; set; }

        [Column(TypeName = "int4")]
        public TaskTypeEnum TaskType { get; set; }

        /// <summary>
        /// 站点编号
        /// </summary>
        [Column(TypeName = "int4")]
        public int PointIndex { get; set; }

        /// <summary>
        /// 任务名称
        /// </summary>
        [Column(TypeName = "varchar(255)")]
        public string TaskName { get; set; }
    }
}